<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
    * {
      margin: 0;
    }
    .father {
      width: 80%;
      height: 150px;
      background-color: pink;
    }
    .son {
      background-color: red;
    }
    .father1 .son {
      width: 20px;
      height: 20px;
    }
    .father2 .son:nth-child(2) {
      margin-left: 10px;
      margin-right: 20px;
      margin-top: 30px;
      margin-bottom: 40px;
    }
    </style>
    <link href="css/style.css" rel="stylesheet">
  </head>
  <body>
    <div class="father father0">
      <span class="son">1</span>
      <span class="son">2</span>
      <span class="son">3</span>
    </div>
    <hr>
    <p>给span设置宽高后没有生效，说明span是行内元素</p>
    <div class="father father1">
      <span class="son">1</span>
      <span class="son">2</span>
      <span class="son">3</span>
    </div>
    <hr>
    <p>给span分别设置四向margin，只有左右生效，原来行内元素还有这一特性</p>
    <div class="father father2">
      <span class="son">1</span>
      <span class="son">2</span>
      <span class="son">3</span>
    </div>
  </body>
</html>
